package creative.fire.interview.common;

enum Shrubbery {
	GROUND, CRAWLING, HANGING
}

public class EnumClass {
	public static void main(String[] args) {
		for (Shrubbery s : Shrubbery.values()) {
			System.out.println(s + " ordinal: " + s.ordinal());
			System.out.println("compareTo: " + s.compareTo(Shrubbery.CRAWLING) + " ");
			System.out.println("equals: " + s.equals(Shrubbery.CRAWLING) + " ");
			System.out.println("== :" + (s == Shrubbery.CRAWLING));
			System.out.println(s.getDeclaringClass());
			System.out.println(s.name());
			System.out.println("----------------------");
		}
		// Produce an enum value from a string name:
		for (String s : "HANGING CRAWLING GROUND".split(" ")) {
			Shrubbery shrub = Enum.valueOf(Shrubbery.class, s);
			System.out.println(shrub);
		}
	}
}
/*
GROUND ordinal: 0
compareTo: -1 
equals: false 
== :false
class enumerated.Shrubbery
GROUND
----------------------
CRAWLING ordinal: 1
compareTo: 0 
equals: true 
== :true
class enumerated.Shrubbery
CRAWLING
----------------------
HANGING ordinal: 2
compareTo: 1 
equals: false 
== :false
class enumerated.Shrubbery
HANGING
----------------------
HANGING
CRAWLING
GROUND
*/
